<section>

  <!-- main content start-->
  <div class="main-content" >

    <div class="panel-body" style="margin-bottom: -15px;">
      <!--<span>-->
      <!--<i class="fa  fa-2x fa-save"></i>-->
      <!--</span>-->
    </div>

    <!--body wrapper start-->
    <div class="wrapper">

      <div class="row" style="margin-top: 10px;">
        <div class="col-md-12">
          <section class="panel">
            <header class="panel-heading">
             司机列表
            </header>

            <form [formGroup]="driverForm">
              <div class="panel-body">
                <div class="col-lg-6">
                  <div class="form-group">
                    <label  ><span class="necessary">*</span>司机代号&nbsp;</label>
                    <div class="input-group  ">
                      <input formControlName="creator" type="hidden" class="form-control " id="creator"/>
                      <input [readonly]="statusFlag"  formControlName="id" type="text" class="form-control " id="id" (blur)="toSearchId()"/>
                      <span class="input-group-btn" >
                            <button id="driverOpenWin" type="button" class="btn btn-default" style="background: #424F63;color: #fff;" (click)="driverOpenWin()" >
                                <i class="fa fa-angle-down"></i>
                            </button>
                      </span>
                    </div>
                   </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group">
                    <label  ><span class="necessary">*</span>司机名称&nbsp;</label>
                    <input formControlName="name" type="text" class="form-control " id="name"/>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group">
                    <label>出生年月&nbsp;</label>
                    <div class="input-group date" id="birthdays">
                      <input readonly formControlName="birthday" class="form-control" type="text" id="birthday"/>
                      <span class="input-group-addon">
                      <span class="fa fa-calendar"></span>
                    </span>
                    </div>
                  </div>
                </div>

                <div class="col-lg-6">
                  <div class="form-group">
                    <label ><span class="necessary">*</span>司机电话&nbsp;</label>
                    <input formControlName="phone" type="text" class="form-control " id="phone"/>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group">
                    <label  ><span class="necessary">*</span>准驾车型&nbsp;</label>
                    <div class="">
                      <select  formControlName="licenseType" class="selectpicker form-control" style="height: 30px" id="licenseType"
                      >
                        <option *ngFor="let gType of licenseTypes" [value]="gType.id">{{gType.name}}</option>
                      </select>
                    </div>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group">
                    <label>领证日期&nbsp;</label>
                    <div class="input-group date" id="certificationDates">
                      <input readonly formControlName="certificationDate" class="form-control" type="text" id="certificationDate"/>
                      <span class="input-group-addon">
                      <span class="fa fa-calendar"></span>
                    </span>
                    </div>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group">
                    <label  ><span class="necessary">*</span>司机性别&nbsp;</label>
                    <div >
                      <nz-radio-group formControlName="gender" [(ngModel)]="radioValue" class="etc">
                        <label nz-radio [nzValue]="1">
                          <span>男</span>
                        </label>
                        <label nz-radio [nzValue]="0">
                          <span>女</span>
                        </label>
                      </nz-radio-group>
                    </div>
                  </div>
                </div><br>
                <div class="col-lg-12">
                  <app-file-upload></app-file-upload>
                </div>

              </div>
              <div class="panel-body">
                <div class="form-group">
                  <div class="pull-right" style=" margin-top: 30px;">
                    <button class="btn btn-primary" type="button" [disabled]="!btnDisabled"  (click)="updateInfo(driverForm.value)">修改</button>
                    <button class="btn btn-default" type="button" [disabled]="btnDisabled"  (click)="onSubmit(driverForm.value)">新增</button>
                    <button class="btn btn-default" type="button" [disabled]="!btnDisabled"  (click)="delType()">删除</button>
                    <button class="btn btn-default" type="button" (click)="clear()">清空</button>
                  </div>
                </div>
              </div>
            </form>
          </section>
        </div>
      </div>



      <!--<div class="panel-body">-->

        <form action="#" class="form-horizontal ">

          <div>

            <div class="input-group m-bot15" >

              <input class="form-control" placeholder="司机名称" type="text" style="  margin-left: 75%;width: 25%; " [formControl]="searchParam" id="searchpa">
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" (click)="searchInfo()"><i class="fa fa-search"></i></button>
              </span>
            </div>

          </div>
          <nz-table #vehicleTable
                    [nzBordered]="true"
                    [nzDataSource]="_dataSet"
                    [nzShowSizeChanger]="true"
                    [nzTotal]="_total"
                    [(nzPageIndex)]="_current"
                    (nzPageIndexChange)="refreshData()"
                    [(nzPageSize)]="_pageSize"
                    (nzPageSizeChange)="refreshData(true)"
                    (nzDataChange)="driverDisplayDataChange($event)">
            <thead nz-thead>
            <tr>
              <th class="table-header" nz-th [nzWidth]="'20%'">
                <span>司机代号</span>
              </th>
              <th class="table-header" nz-th [nzWidth]="'20%'">
                <span>司机名称</span>
              </th>
              <th class="table-header" nz-th [nzWidth]="'20%'">
                <span>司机性别</span>
              </th>
              <th class="table-header" nz-th [nzWidth]="'20%'">
                <span>司机电话</span>
              </th>
              <th class="table-header" nz-th [nzWidth]="'20%'">
                <span>准驾车型</span>
              </th>
              <!--<th class="table-header" nz-th [nzWidth]="'5%'">-->
              <!--<span>删除</span>-->
              <!--</th>-->
            </tr>
            </thead>
            <tbody nz-tbody>
            <tr nz-tbody-tr *ngFor="let data of vehicleTable.data" [class.selected]="data === selected" (click)="onSelect(data)">
              <td nz-td >{{data.id}}</td>
              <td nz-td >{{data.name}}</td>
              <td nz-td >{{data.gender==1?"男":"女"}}</td>
              <td nz-td >{{data.phone}}</td>
              <td nz-td >{{data.licenseType}}</td>
              <!--<td nz-td><i class="fa fa-times" aria-hidden="true" style="color:#424F63;" (click)="delType(data)"></i></td>-->
            </tr>
            </tbody>
          </nz-table>

        </form>
      <!--</div>-->
    </div>
    <!--body wrapper end-->
  </div>
  <!-- main content end-->
</section>

<!-- 司机开窗modal -->
<nz-modal id="udgModal"  [nzVisible]="userIsVisible" [nzTitle]="'单选人员开窗'" [nzContent]="userModalContent"
          [nzFooter]="false" (nzOnCancel)="userHandleCancel($event)" >
  <ng-template #userModalContent>
    <app-user-table></app-user-table>
  </ng-template>
</nz-modal>
<!-- modal -->
